package com.itheima.mapper;

import com.itheima.pojo.Student;
import com.itheima.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper {

    List<Student> page(StudentQueryParam studentQueryParam);
    @Insert("insert into web01.student(name, no, gender, phone, id_card, is_college, address, degree, graduation_date, clazz_id) values " +
            "(#{name},#{no},#{gender},#{phone},#{idCard},#{isCollege},#{address},#{degree},#{graduationDate},#{clazzId})")
    void insert(Student student);

    void deleteById(List<Integer> ids);

    @Select("select  * from web01.student where id = #{id}")
    Student getStuById(Integer id);

    void update(Student student);
}
